package exception;

public class UseBuilderException {

    private class UseBuilderExceptionImpl extends RuntimeException {
        
        private static final long serialVersionUID = -609157085110856454L;

        UseBuilderExceptionImpl(String message) {
            super(message);
        }
        
    }
    
    public UseBuilderException message(String message) {
        this.message = message;
        return this;
    }
    
    public UseBuilderException cause(Exception cause) {
        this.cause = cause;
        return this;
    }
    
    public Exception newInstance() {
        Exception exception = new UseBuilderExceptionImpl(this.message);
        exception.initCause(cause);
        return exception;
    }
    
    
    
    private String message;
    private Throwable cause;
    
    /** Serialization version */
    private static final long serialVersionUID = -6289039315406989431L;

}
